import { createRouter, createWebHashHistory } from 'vue-router'
import About from '../views/About.vue'
import Home from '../views/Home.vue'
import News from '../views/News.vue'
import A from '../views/A.vue'
import B from '../views/B.vue'
import C from '@/views/C.vue'



//1.配置路由规则
const routes=[
    {path:'/',redirect: '/a'},
    {path:'/home' ,component:Home},
    {path:'/about' ,component:About},
    {path:'/news' , component:News,name:'news'},
    {path:'/a' , component:A},
    {path:'/b' , component:B},
    {path:'/c/:dishId/:dishName/:dishPrice' , component:C},

]
//2.创建路由
const router=createRouter({
    history:createWebHashHistory(),//路由工作模式
    routes
})

//将路由暴露出去
export default router